<?php

	// include db handler
	require_once 'DB_Functions.php';
    $db = new DB_Functions();
 
	//$path = "images/";
	$place_name = $_POST['name'];
	$place_description = $_POST['description'];
	$longtitude = $_POST['long'];
	$latitude = $_POST['lat'];
	$data = file_get_contents($_FILES['userfile']['tmp_name']);
	$user_id ='a';
	
	$db->addPlaceMaps( $place_name, $place_description, $user_id, $longtitude, $latitude, $data );
	
	//$path = $path . basename( $_FILES['userfile']['name']);
	
	//addPlaceMaps("123", ($_FILES['userfile']['name'])); 
	/*
	if( move_uploaded_file($_FILES['userfile']['tmp_name'], $path) ) {
		
		echo "Success uploading". basename($_FILES['userfile']['name']);
	} else{
		echo "Error when uploading file.";
	} 
	*/
?>
